<@override name="title">菜品信息</@override>

<@override name="styles">
<link href="${ctx}/static/plugins/datatables/dataTables.bootstrap.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="${ctx}/static/plugins/daterangepicker/daterangepicker-bs3.css">
<link rel="stylesheet" href="${ctx}/static/plugins/lightbox2/css/lightbox.css">
</@override>


<@override name="header">
<h4>
    <ol class="breadcrumb">
        <li><a href="#"><i class="fa fa-map-marker"></i>&nbsp;&nbsp; 菜品管理</a></li>
        <li><a href="#">菜品信息</a></li>
    </ol>
</h4>
</@override>

<@override name="content">
<div class="row">
    <div class="col-xs-12">
        <div class="box">
            <div class="box-header with-border" style="padding-bottom:0;">
                <div class="col-lg-9">
                    <form class="form-horizontal" action="#" role="form" id="search-form">
                        <div class="form-group ">
                            <label class="col-sm-2 control-label text-left" style="width:10%;">名称:</label>
                            <div class="col-sm-3" style="width:20%;">
                                <input type="text" name="f-d.name-LIKE" class="form-control">
                            </div>
                            <label class="col-sm-2 control-label text-left" style="width:15%;">菜品分类:</label>
                            <div class="col-sm-3" style="padding-right: 0;">
                                <select data-placeholder="请选择菜品分类..." class="form-control validate[required]" name="f-c.id-EQ">
                                    <option value="">请选择</option>
                                    <#list categories as item>
                                        <option value="${item.id!}">${item.name!}</option>
                                    </#list>
                                </select>
                            </div>
                            <div class="col-sm-2" style="width: 23%;">
                                <div class="btn-group">
                                    <input type="button" id="search" value="查询" class="btn btn-primary">
                                    <input type="button" id="cancel" value="取消" class="btn btn-default">
                                </div>
                            </div>
                        </div>
                    </form>
                </div>
                <a class="btn btn-default pull-right" href="${ctx}/dishes/dish/item/0">
                    <i class="fa fa-plus"></i> 新建
                </a>
            </div>
            <div class="box-body">
                <table id="data-table" class="table table-bordered table-hover thumbnail-table">
                    <thead>
                    <tr>
                        <th></th>
                        <th>封面</th>
                        <th>名称</th>
                        <th>分类</th>
                        <th>价格</th>
                        <th>热门</th>
                        <th>状态</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                </table>
            </div>
        </div><!-- /.box -->
    </div><!-- /.col -->
</div><!-- /.row -->


<script id="data-table-action" type="text/x-handlebars-template">
    <a class="btn btn-info" href="${ctx!}/dishes/dish/item/{{id}}">编辑</a>
    <a class="btn btn-warning dt-ajax" data-href="${ctx!}/dishes/dish/delete/{{id}}">删除</a>
    {{#if status}}
    <a class="btn btn-danger dt-ajax" data-href="${ctx!}/dishes/dish/status/{{id}}/0">停售</a>
    {{else}}
    <a class="btn btn-success dt-ajax" data-href="${ctx!}/dishes/dish/status/{{id}}/1">在售</a>
    {{/if}}
</script>

<script id="cover-template" type="text/x-handlebars-template">
    <a href="${ctx!}/uploads/{{path}}" data-lightbox="image-{{id}}" data-title="{{name}}">
        <span class="thumbnail">
            <img src="${ctx!}/uploads/{{path_thumb}}">
        </span>
    </a>
</script>

<script id="hot-template" type="text/x-handlebars-template">
    {{#if is_hot}}
    <span class="text-success">是</span>
    {{else}}
    <span class="text-danger">否</span>
    {{/if}}
</script>

<script id="status-template" type="text/x-handlebars-template">
    {{#if status}}
    <span class="text-success">在售</span>
    {{else}}
    <span class="text-danger">停售</span>
    {{/if}}
</script>

</@override>

<@override name="scripts">
<!-- DATA TABES SCRIPT -->
<script src="${ctx}/static/plugins/datatables/jquery.dataTables.js" type="text/javascript"></script>
<script src="${ctx}/static/plugins/datatables/dataTables.bootstrap.js" type="text/javascript"></script>
<script src="${ctx}/static/plugins/datatables/datatables.js" type="text/javascript"></script>

<!-- date-range-picker -->
<script src="${ctx}/static/plugins/daterangepicker/date.js"></script>
<script src="${ctx}/static/plugins/daterangepicker/daterangepicker-zh_CN.js"></script>

<script src="${ctx}/static/plugins/lightbox2/js/lightbox.js"></script>

<script type="text/javascript" src="${ctx}/static/views/dishes/dish/index.js"></script>
</@override>

<@extends name="/WEB-INF/_basic/main.ftl"/>